package com.yzt.base.utils;

import org.apache.shiro.crypto.hash.Sha256Hash;
import org.apache.shiro.crypto.hash.SimpleHash;

public class ShiroUtils {

	/**
	 * Shiro加密 <br>
	 * 加密方式为：SHA-256<br>
	 * 散列次数为：10次<br>
	 * 存储方式为：Base64<br>
	 * 
	 * @param pass
	 * @param salt
	 * @return
	 */
	public static String encode(String pass, String salt) {
		SimpleHash hash = new SimpleHash(Sha256Hash.ALGORITHM_NAME, pass, salt, 10);
		return hash.toBase64();
	}
}
